<?php
namespace Home\Controller;
use Think\Controller;
class AuthorizationController extends CommonController {
     
     //浏览授权信息
    public function index(){
       
       if(IS_POST)
       {  
          //解决empty报错，不能直接对函数返回值使用empty,需要先赋值
          $key = I('post.key');
          if(!empty($key))
          {
              
              $map['phone|wechat'] = array('EQ',$key);
              $mod = M('authorization');
              $data = $mod->where($map)->find();
              // dump($data);die;
              if($data)
              {
                $this->assign('data',$data);
              }
              else
              {
                $this->assign('status',1);
              }
          }
  
       }
       // dump($key);die;
       $this->assign('keys',$key);
       $this->assign('title','授权查询');
       //加载模板输出
       $this->display("index");
    }

    public function anti_fake(){
      
       $this->assign('title','防伪查询');
       //加载模板输出
       $this->display("anti_fake");
    }


}